Integrated circuit for network delay and jitter testing

ABSTRACT

An integrated circuit having a corresponding method comprises one or more ports to transmit and receive packets of first data; and a forwarding engine to transfer the packets of the first data between the ports; wherein at least one of the ports comprises a packet generator to originate a first packet of the first data comprising second data representing a time of transmission of the first packet of the first data, a network transmit interface to transmit the first packet of the first data, and a network receive interface to receive a second packet of the first data transmitted in reply to the first packet of the first data; and a controller to calculate a network delay based on the second data representing the time of transmission of the first packet of the first data and the second packet of the first data.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Patent Application Ser. No. 60/642,483 entitled “Integrated Circuit For Network Delay and Jitter Testing,” filed Jan. 7, 2005, the disclosure thereof incorporated by reference herein in its entirety.

This application is related to copending U.S. Non-Provisional patent application Ser. No. 11/031,984 entitled “Integrated Circuit For Network Stress Testing,” filed Jan. 7, 2005, the disclosure thereof incorporated by reference herein in its entirety.

BACKGROUND

The present invention relates generally to network testing. More particularly, the present invention relates to integrated circuits for testing network delay and jitter.

Data networks are becoming increasingly important to all sectors of the economy. As the reliance on these data networks rises, so do the costs of network downtime or even less than optimal network performance. For these reasons, network testing, troubleshooting, and monitoring has also become increasingly important.

One approach to network testing is to purchase and deploy specialized network test equipment to test the network. One disadvantage of this approach is that such equipment is very expensive, especially when capable of testing very fast networks. Another disadvantage is that installing this specialized equipment to obtain meaningful measurements usually requires changing the network topology, possibly interfering with the normal operation of the network.

Another approach is to run network testing applications in existing network devices such as routers and the like that have built-in central processing units (CPUs). One disadvantage of this approach is that the network testing applications burden the CPUs and therefore reduce the performance of such network devices in their normal network roles. Furthermore, these CPUs are limited in performance relative to the number of ports and their speed in the network, and so cannot handle traffic at wirespeed.

SUMMARY

In general, in one aspect, the invention features an integrated circuit comprising: one or more ports to transmit and receive packets of first data; and a forwarding engine to transfer the packets of the first data between the ports; wherein at least one of the ports comprises a packet generator to originate a first packet of the first data comprising second data representing a time of transmission of the first packet of the first data, a network transmit interface to transmit the first packet of the first data, and a network receive interface to receive a second packet of the first data transmitted in reply to the first packet of the first data; and a controller to calculate a network delay based on the second data representing the time of transmission of the first packet of the first data and the second packet of the first data.

Particular implementations can include one or more of the following features. The controller calculates the network delay based on the second data representing the time of transmission of the first packet of the first data and a time of receipt of the second packet of the first data by the network receive interface. The second packet of the first data comprises third data; and wherein the controller calculates the network delay based on the second data representing the time of transmission of the first packet of the first data and the third data in the second packet of the first data. The third data in the second packet of the first data represents a time of transmission of the second packet of the first data. The third data in the second packet of the first data represents a time of receipt of the first packet of the first data. The controller calculates a plurality of the network delays; and determines a network jitter based on the plurality of the network delays. The at least one of the ports further comprises: an egress queue to store the packets of the first data received by the at least one of the ports from the forwarding engine; a test queue to store the packets of the first data originated by the packet generator; and a scheduler comprising a first input in communication with the egress queue, a second input in communication with the test queue, and an output in communication with the network transmit interface. The at least one of the ports further comprises: an ingress queue to store the packets of the first data received by the network receive interface. The integrated circuit further comprises: a classifier to determine one or more properties of the packets of the first data received by the network receive interface; a counter to count a number of packets of the first data received by the network receive interface that have properties that match one or more property definitions. The one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the ports in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data. The at least one of the ports: receives a request for the contents of the counter; and transmits a packet of the first data comprising the contents of the counter. A network switch comprises the integrated circuit. A network device comprises the integrated circuit. A network device comprises the integrated circuit. The network device further comprises: a user interface to provide the one or more property definitions to the integrated circuit, and to retrieve the contents of the counter.

In general, in one aspect, the invention features a method for an integrated circuit comprising: transmitting and receive packets of first data on a plurality of ports of the integrated circuit; transferring the packets of the first data between the ports; originating a first packet of the first data comprising second data representing a time of transmission of the first packet of the first data; transmitting the first packet of the first data; receiving a second packet of the first data transmitted in reply to the first packet of the first data; and calculating a network delay based on the second data representing the time of transmission of the first packet of the first data and the second packet of the first data.

Particular implementations can include one or more of the following features. The network delay is calculated based on the second data representing the time of transmission of the first packet of the first data and a time of receipt of the second packet of the first data by the integrated circuit. The second packet of the first data comprises third data; and wherein the network delay is calculated based on the second data representing the time of transmission of the first packet of the first data and the third data in the second packet of the first data. The third data in the second packet of the first data represents a time of transmission of the second packet of the first data. The third data in the second packet of the first data represents a time of receipt of the first packet of the first data. The method further comprises: calculating a plurality of the network delays; and determining a network jitter based on the plurality of the network delays. The method further comprising: determining one or more properties of the received packets of the first data; counting a number of packets of the first data received by the network receive interface that have properties that match one or more property definitions. The one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the ports in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data. The method further comprises: receiving a request for the number of packets of the first data received by the network receive interface that have properties that match the one or more property definitions; and transmitting a packet of the first data comprising the number of packets of the first data received by the network receive interface that have properties that match the one or more property definitions.

In general, in one aspect, the invention features an integrated circuit comprising: one or more ports to transmit and receive packets of first data; and a host interface to transmit and receive the packets of the first data; wherein at least one of the ports comprises a packet generator to originate a first packet of the first data comprising second data representing a time of transmission of the first packet of the first data, a network transmit interface to transmit the first packet of the first data, a network receive interface to receive a second packet of the first data transmitted in reply to the first packet of the first data; and a controller to calculate a network delay based on the second data representing the time of transmission of the first packet of the first data and the second packet of the first data.

Particular implementations can include one or more of the following features. The controller calculates the network delay based on the second data representing the time of transmission of the first packet of the first data and a time of receipt of the second packet of the first data by the network receive interface. The second packet of the first data comprises third data; and wherein the controller calculates the network delay based on the second data representing the time of transmission of the first packet of the first data and the third data in the second packet of the first data. The third data in the second packet of the first data represents a time of transmission of the second packet of the first data. The third data in the second packet of the first data represents a time of receipt of the first packet of the first data. The controller calculates a plurality of the network delays; and determines a network jitter based on the plurality of the network delays. The at least one of the ports further comprises: an egress queue to store the packets of the first data received by the at least one of the ports from the host interface; a test queue to store the packets of the first data originated by the packet generator; and a scheduler comprising a first input in communication with the egress queue, a second input in communication with the test queue, and an output in communication with the network transmit interface. The at least one of the ports further comprises: an ingress queue to store the packets of the first data received by the network receive interface. The at least one of the ports further comprises a network receive interface to receive packets of the first data; and wherein the integrated circuit further comprises a classifier to determine one or more properties of the packets of the first data received by the network receive interface, and a counter to count a number of packets of the first data received by the network receive interface that have properties that match one or more property definitions. The one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the ports in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data. The at least one of the ports: receives a request for the contents of the counter; and transmits a packet of the first data comprising the contents of the counter. A network switch comprising the integrated circuit. A network device comprising the integrated circuit. A network device comprising the integrated circuit. The network device further comprises: a user interface to provide the one or more property definitions to the integrated circuit, and to retrieve the contents of the counter.

In general, in one aspect, the invention features a method for an integrated circuit comprising: transmitting and receiving packets of first data on one or more ports of the integrated circuit; originating a first packet of the first data comprising second data representing a time of transmission of the first packet of the first data, transmitting the first packet of the first data, receiving a second packet of the first data transmitted in reply to the first packet of the first data; and calculating a network delay based on the second data representing the time of transmission of the first packet of the first data and the second packet of the first data.

Particular implementations can include one or more of the following features. The network delay is calculated based on the second data representing the time of transmission of the first packet of the first data and a time of receipt of the second packet of the first data by the network receive interface. The second packet of the first data comprises third data; and wherein the network delay is calculated based on the second data representing the time of transmission of the first packet of the first data and the third data in the second packet of the first data. The third data in the second packet of the first data represents a time of transmission of the second packet of the first data. The third data in the second packet of the first data represents a time of receipt of the first packet of the first data. The method further comprises: calculating a plurality of the network delays; and determining a network jitter based on the plurality of the network delays. The method further comprises: determining one or more properties of the received packets of the first data, and counting a number of packets of the first data received by the network receive interface that have properties that match one or more property definitions. The one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the ports in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data. The method further comprises: receiving a request for the number of packets of the first data received by the network receive interface that have properties that match the one or more property definitions; and transmitting a packet of the first data comprising the number of packets of the first data received by the network receive interface that have properties that match the one or more property definitions.

In general, in one aspect, the invention features an integrated circuit comprising: one or more port means for transmitting and receiving packets of first data; and forwarding means for transferring the packets of the first data between the ports; wherein at least one of the port means comprises packet generator means for originating a first packet of the first data comprising second data representing a time of transmission of the first packet of the first data, network transmit means for transmitting the first packet of the first data, and network receive means for receiving a second packet of the first data transmitted in reply to the first packet of the first data; and controller means for calculating a network delay based on the second data representing the time of transmission of the first packet of the first data and the second packet of the first data.

Particular implementations can include one or more of the following features. The controller means calculates the network delay based on the second data representing the time of transmission of the first packet of the first data and a time of receipt of the second packet of the first data by the network receive means. The second packet of the first data comprises third data; and wherein the controller means calculates the network delay based on the second data representing the time of transmission of the first packet of the first data and the third data in the second packet of the first data. The third data in the second packet of the first data represents a time of transmission of the second packet of the first data. The third data in the second packet of the first data represents a time of receipt of the first packet of the first data. the controller means calculates a plurality of the network delays; and determines a network jitter based on the plurality of the network delays. The at least one of the port means further comprises: egress queue means for storing the packets of the first data received by the at least one of the ports from the forwarding means; test queue means for storing the packets of the first data originated by the packet generator means; and scheduler means comprising first input means for communicating with the egress queue means, second input means for communicating with the test queue means, and output means for communicating with the network transmit means. The at least one of the port means further comprises: ingress queue means for storing the packets of the first data received by the network receive means. The integrated circuit further comprises: classifier means for determining one or more properties of the packets of the first data received by the network receive means; counter means for counting a number of packets of the first data received by the network receive means that have properties that match one or more property definitions. The one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the port means in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data. The at least one of the ports: receives a request for the contents of the counter means; and transmits a packet of the first data comprising the contents of the counter means. A network switch comprises the integrated circuit. A network device comprises the integrated circuit. A network device comprises the integrated circuit. The network device further comprises: user interface means for providing the one or more property definitions to the integrated circuit, and for retrieving the contents of the counter means.

In general, in one aspect, the invention features a computer program for an integrated circuit transmitting and receive packets of first data on a plurality of ports of the integrated circuit, the computer program comprising: originating a first packet of the first data comprising second data representing a time of transmission of the first packet of the first data; causing the integrated circuit to transmit the first packet of the first data; wherein the integrated circuit receives a second packet of the first data transmitted in reply to the first packet of the first data; and calculating a network delay based on the second data representing the time of transmission of the first packet of the first data and the second packet of the first data.

Particular implementations can include one or more of the following features. The network delay is calculated based on the second data representing the time of transmission of the first packet of the first data and a time of receipt of the second packet of the first data by the integrated circuit. The second packet of the first data comprises third data; and wherein the network delay is calculated based on the second data representing the time of transmission of the first packet of the first data and the third data in the second packet of the first data. The third data in the second packet of the first data represents a time of transmission of the second packet of the first data. The third data in the second packet of the first data represents a time of receipt of the first packet of the first data. The computer program further comprises: calculating a plurality of the network delays; and determining a network jitter based on the plurality of the network delays. The computer program further comprises: determining one or more properties of the received packets of the first data; counting a number of packets of the first data received by the integrated circuit that have properties that match one or more property definitions. The one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the ports in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data. The computer program further comprises: receiving a request for the number of packets of the first data received by the network receive interface that have properties that match the one or more property definitions; and causing the integrated circuit to transmit a packet of the first data comprising the number of packets of the first data received by the network receive interface that have properties that match the one or more property definitions.

In general, in one aspect, the invention features an integrated circuit comprising: one or more port means for transmitting and receiving packets of first data; and host interface means for transmitting and receiving the packets of the first data; wherein at least one of the port means comprises packet generator means for originating a first packet of the first data comprising second data representing a time of transmission of the first packet of the first data, network transmit means for transmitting the first packet of the first data, network receive means for receiving a second packet of the first data transmitted in reply to the first packet of the first data; and controller means for calculating a network delay based on the second data representing the time of transmission of the first packet of the first data and the second packet of the first data.

Particular implementations can include one or more of the following features. The controller means calculates the network delay based on the second data representing the time of transmission of the first packet of the first data and a time of receipt of the second packet of the first data by the network receive means. The second packet of the first data comprises third data; and wherein the controller means calculates the network delay based on the second data representing the time of transmission of the first packet of the first data and the third data in the second packet of the first data. The third data in the second packet of the first data represents a time of transmission of the second packet of the first data. The third data in the second packet of the first data represents a time of receipt of the first packet of the first data. The controller means calculates a plurality of the network delays; and determines a network jitter based on the plurality of the network delays. The at least one of the port means further comprises: egress queue means for storing the packets of the first data received by the at least one of the ports from the host interface means; test queue means for storing the packets of the first data originated by the packet generator means; and means for scheduling comprising first input means for communicating with the egress queue means, second input means for communicating with the test queue means, and output means for communicating with the network transmit means. The at least one of the port means further comprises: ingress queue means for storing the packets of the first data received by the network receive means. The at least one of the port means further comprises network receive means for receiving packets of the first data; and wherein the integrated circuit further comprises classifier means for determining one or more properties of the packets of the first data received by the network receive means, and counter means for counting a number of packets of the first data received by the network receive means that have properties that match one or more property definitions. The one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the port means in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data. The at least one of the port means: receives a request for the contents of the counter means; and transmits a packet of the first data comprising the contents of the counter means. A network switch comprises the integrated circuit. A network device comprising the integrated circuit. A network device comprising the integrated circuit. The network device further comprises: user interface means for providing the one or more property definitions to the integrated circuit, and to retrieve the contents of the counter means.

In general, in one aspect, the invention features a computer program for an integrated circuit transmitting and receiving packets of first data on one or more ports of the integrated circuit, the computer program comprising: originating a first packet of the first data comprising second data representing a time of transmission of the first packet of the first data, causing the integrated circuit to transmit the first packet of the first data, wherein the integrated circuit receives a second packet of the first data transmitted in reply to the first packet of the first data; and calculating a network delay based on the second data representing the time of transmission of the first packet of the first data and the second packet of the first data.

Particular implementations can include one or more of the following features. The network delay is calculated based on the second data representing the time of transmission of the first packet of the first data and a time of receipt of the second packet of the first data by the integrated circuit. The second packet of the first data comprises third data; and wherein the network delay is calculated based on the second data representing the time of transmission of the first packet of the first data and the third data in the second packet of the first data. The third data in the second packet of the first data represents a time of transmission of the second packet of the first data. The third data in the second packet of the first data represents a time of receipt of the first packet of the first data. The computer program further comprises: calculating a plurality of the network delays; and determining a network jitter based on the plurality of the network delays. The computer program further comprises: determining one or more properties of the received packets of the first data, and counting a number of packets of the first data received by the integrated circuit that have properties that match one or more property definitions. The one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the ports in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data. The computer program further comprises: receiving a request for the number of packets of the first data received by the network receive interface that have properties that match the one or more property definitions; and causing the integrated circuit to transmit a packet of the first data comprising the number of packets of the first data received by the network receive interface that have properties that match the one or more property definitions.

The details of one or more implementations are set forth in the accompanying drawings and the description below. Other features will be apparent from the description and drawings, and from the claims.

DESCRIPTION OF DRAWINGS

FIG. 1 shows a network switch application-specific integrated circuit (ASIC) in communication with a network according to a preferred embodiment of the present invention.

FIG. 2 shows a process for the ASIC of FIG. 1 according to a preferred embodiment.

FIG. 3 shows a process for packet counting according to a preferred embodiment.

FIG. 4 shows a network interface controller ASIC in communication with a host and a network according to a preferred embodiment of the present invention.

FIG. 5 shows a process for the ASIC of FIG. 6 according to a preferred embodiment.

FIG. 6 shows a process for packet counting according to a preferred embodiment.

The leading digit(s) of each reference numeral used in this specification indicates the number of the drawing in which the reference numeral first appears.

DETAILED DESCRIPTION

Embodiments of the present invention provide integrated circuits that conduct network delay and jitter testing at the media access control (MAC) level and above. Because the testing occurs at the ASIC level, the CPUs in network devices employing integrated circuits according to the present invention are only minimally burdened by the testing.

The networks tested can include any sort of network such as wired, wireless, optical, and so on, and can range in scope from a single network device to very large networks comprising many network devices. While embodiments of the present invention are described with respect to a network switch embodiment and a network interface controller embodiment, it will be understood by those skilled in the relevant arts after reading this description that embodiments of the present invention can be implemented in other sorts of network devices as well, such as wireless access points, wireless clients, and the like.

FIG. 1 shows a network switch application-specific integrated circuit (ASIC) 100 in communication with a network 102 according to a preferred embodiment of the present invention. ASIC 100 comprises a forwarding engine 104 to transfer packets of data between a plurality of ports 106A through 106N, a classifier 108 to determine properties of packets received by ASIC 100, a timer 134 to provide a time basis for the delay and jitter measurements, one or more optional counters 110 to count packets, and a memory 136 for storing contents of the counters and parameters calculated based on those contents. In some embodiments, some or all of timer 134 and counters 110 are implemented within ports 106. Preferably ASIC 100 comprises various counters. Those on the port level simply count how many packets are received and sent. More sophisticated counters also on the port level can count certain type of packets based on low-level indications such as bad CRC, runt packets, packets too long, and the like. Each block comprises additional counters that can count the criteria supported by that block. For example, forwarding engine 104 comprises counters that can count how many packets have been received or sent on a specific route. As another example, classifier 108 comprises counters that count only packets belonging to a specific flow.

FIG. 1 also shows detail of one of the ports 106A, which comprises a media access controller (MAC) 112, a network receive interface 114 to receive packets of data from network 102, and a network transmit interface 116 to transmit packets of data to network 102. MAC 112 comprises a MAC controller 118, one or more ingress queues 120 to store packets received by port 106A from network 102, and one or more egress queues 122 to store packets to be transmitted by port 106A to network 102. In some embodiments, some or all of the functions of MAC controller 118 are implemented in a central controller in ASIC 100.

Port 106A also comprises a packet generator 128 to generate one or more packets comprising a time stamp according to timer 134, one or more generator queues 126 to store packets generated by packet generator 128, and a scheduler 130 to schedule packets in egress queues 124 and generator queues 126 for transmission to network 102. This arrangement permits ASIC 100 to conduct network testing while also handling regular network traffic.

FIG. 2 shows a process 200 for ASIC 100 of FIG. 1 according to a preferred embodiment. ASIC 100 operates as a network switch. Therefore ports 106 transmit and receive packets of data to and from network 102 (step 202) and forwarding engine 104 transfers the packets between ports 106 (step 204) according to methods well-known in the relevant arts.

Port 106A measures network delay and jitter according to a preferred embodiment. MAC controller 118 generates a packet comprising a time stamp representing a time of transmission of the packet (step 206). Network transmit interface 116 transmits the packet originated by the packet generator (step 208). As used herein, the terms “originate” and “originated” are used to indicate that the packets so described are packets that are generated by a packet generator 128 in a MAC 106, in contrast to packets that merely pass through a MAC 106, such as packets received from network 102 or forwarding engine 104.

The packet originated and transmitted by port 106A is received by a network device (step 210), which transmits a reply to the packet (step 212). Port 106A receives the reply packet (step 214) and store the reply packet in ingress queues 120.

Controller 118 calculates a network delay based on the reply packet and the time stamp in the packet originated and transmitted by port 106A (step 216). In one embodiment, controller 118 calculates a two-way network delay based on the time of receipt of the reply packet. In another embodiment, controller 118 calculates a one-way network delay based on a time stamp in the reply packet that represents a time of transmission of the reply packet or a time of receipt of the packet originated and transmitted by port 106A.

In some embodiments, ASIC 100 makes a plurality of network delay calculations, and determines a network jitter based on those calculations (step 218). For example, the network jitter can be determined as the standard deviation of the network delays. Of course, other calculations for determining network jitter can be employed.

These network delay and network jitter tests can be implemented without burdening any CPU controlling ASIC 100. For example, in response to a command provided by such a CPU, ASIC 100 can execute process 200 of FIG. 2 and provide network delay and network jitter results to the CPU. The only burden to the CPU is the time required to send the command and receive the results.

In some embodiments ASIC 100 also counts certain packets received from network 102, for example to support a packet loss calculation by another ASIC. FIG. 3 shows a process 300 for such packet counting according to a preferred embodiment. A port 106 in ASIC 100 receives a plurality of packets (step 302) and stores them in ingress queues 120. Classifier 108 determines one or more properties of the packets (step 304). Preferably classifier 108 is implemented using a Ternary Content Addressable Memory (TCAM) with a dual lookup within the TCAM for each packet. One lookup is a search dedicated to detecting the packet parameters for the present invention. The other lookup classifies regular network traffic, for example to address access control list (ACL) and quality of service (QoS) applications.

One or more of counters 110 counts the number of received packets having properties that match one or more property definitions (step 306). The property definitions can include, for example, a value for a field in the packets that indicates the packets were originated by one of the ports 106 in ASIC 100, a value for a field in packets that indicates the packets were originated by a port in another ASIC, one or more qualities of service for the packets, and the like.

ASIC 100 optionally transmits the packet count in response to a request. ASIC 100 receives a request for the contents of one or more of counters 110 (step 308). In response, ASIC 100 transmits a packet of data comprising the contents of counter(s) 110 (step 310).

ASIC 100 can be implemented in a network device such as a network switch. The network switch can include a user interface to provide the one or more packet definitions and property definitions to ASIC 100, and to retrieve data from ASIC 100, such as the contents of counter(s) 110.

FIG. 4 shows a network interface controller ASIC 400 in communication with a host 432 and a network 402 according to a preferred embodiment of the present invention. ASIC 400 comprises a host interface 404 to exchange packets of data with host 432, a port 406 to exchange packets of data with network 402, a classifier 408 to determine properties of packets received by ASIC 400, a timer 434 to provide a time basis for the delay and jitter measurements, one or more optional counters 410 to count packets, and a memory 436 for storing contents of the counters and parameters calculated based on those contents. In some embodiments, some or all of timer 434 and counters 410 are implemented within port 406.

FIG. 4 also shows detail of port 406, which comprises a media access controller (MAC) 412, a network receive interface 414 to receive packets of data from network 402, and a network transmit interface 416 to transmit packets of data to network 402. MAC 412 comprises a MAC controller 418, one or more ingress queues 420 to store packets received by port 406 from network 402, and one or more egress queues 422 to store packets to be transmitted by port 406 to network 402. In some embodiments, some or all of the functions of MAC controller 418 are implemented in a central controller in ASIC 400.

Port 406 also comprises a packet generator 428 to generate one or more packets comprising a time stamp according to timer 434, one or more generator queues 426 to store packets generated by packet generator 428, and a scheduler 430 to schedule packets in egress queues 424 and generator queues 426 for transmission to network 402. This arrangement permits ASIC 400 to conduct network testing while also handling regular network traffic.

FIG. 5 shows a process 500 for ASIC 400 of FIG. 4 according to a preferred embodiment. ASIC 400 operates as a network interface controller. Therefore port 406 transmits and receives packets of data to and from network 402 (step 502) and host interface 404 transfers the packets between port 406 and host 432 (step 504) according to methods well-known in the relevant arts.

Port 406 measures network delay and jitter according to a preferred embodiment. MAC controller 418 generates a packet comprising a time stamp representing a time of transmission of the packet (step 506). Network transmit interface 416 transmits the packet originated by the packet generator (step 508). As used herein, the terms “originate” and “originated” are used to indicate that the packets so described are packets that are generated by a packet generator 428 in a MAC 406, in contrast to packets that merely pass through a MAC 406, such as packets received from network 402 or forwarding engine 404.

The packet originated and transmitted by port 406 is received by a network device (step 510), which transmits a reply to the packet (step 512). Port 406 receives the reply packet (step 514) and store the reply packet in ingress queues 420.

Controller 418 calculates a network delay based on the reply packet and the time stamp in the packet originated and transmitted by port 406 (step 516). In one embodiment, controller 418 calculates a two-way network delay based on the time of receipt of the reply packet. In another embodiment, controller 418 calculates a one-way network delay based on a time stamp in the reply packet that represents a time of transmission of the reply packet or a time of receipt of the packet originated and transmitted by port 406.

In some embodiments, ASIC 400 makes a plurality of network delay calculations, and determines a network jitter based on those calculations (step 518). For example, the network jitter can be determined as the standard deviation of the network delays. Of course, other calculations for determining network jitter can be employed.

These network delay and network jitter tests can be implemented without burdening any CPU controlling ASIC 400. For example, in response to a command provided by such a CPU, ASIC 400 can execute process 500 of FIG. 5 and provide network delay and network jitter results to the CPU. The only burden to the CPU is the time required to send the command and receive the results.

In some embodiments ASIC 400 also counts certain packets received from network 402, for example to support a packet loss calculation by another ASIC. FIG. 6 shows a process 600 for such packet counting according to a preferred embodiment. Port 406 in ASIC 400 receives a plurality of packets (step 602) and stores them in ingress queues 420. Classifier 408 determines one or more properties of the packets (step 604). Preferably classifier 408 is implemented according to a dual lookup for each packet, as described above.

One or more of counters 410 counts the number of received packets having properties that match one or more property definitions (step 606). The property definitions can include, for example, a value for a field in the packets that indicates the packets were originated by one of the ports 406 in ASIC 400, a value for a field in packets that indicates the packets were originated by a port in another ASIC, one or more qualities of service for the packets, and the like.

ASIC 400 optionally transmits the packet count in response to a request. ASIC 400 receives a request for the contents of one or more of counters 410 (step 608). In response, ASIC 400 transmits a packet of data comprising the contents of counter(s) 410 (step 610).

ASIC 400 can be implemented in a network device such as a network interface card. The network interface card can include a user interface to provide the one or more packet definitions and property definitions to ASIC 400, and to retrieve data from ASIC 400, such as the contents of counter(s) 410.

The invention can be implemented in digital electronic circuitry, or in computer hardware, firmware, software, or in combinations of them. Apparatus of the invention can be implemented in a computer program product tangibly embodied in a machine-readable storage device for execution by a programmable processor; and method steps of the invention can be performed by a programmable processor executing a program of instructions to perform functions of the invention by operating on input data and generating output. The invention can be implemented advantageously in one or more computer programs that are executable on a programmable system including at least one programmable processor coupled to receive data and instructions from, and to transmit data and instructions to, a data storage system, at least one input device, and at least one output device. Each computer program can be implemented in a high-level procedural or object-oriented programming language, or in assembly or machine language if desired; and in any case, the language can be a compiled or interpreted language. Suitable processors include, by way of example, both general and special purpose microprocessors. Generally, a processor will receive instructions and data from a read-only memory and/or a random access memory. Generally, a computer will include one or more mass storage devices for storing data files; such devices include magnetic disks, such as internal hard disks and removable disks; magneto-optical disks; and optical disks. Storage devices suitable for tangibly embodying computer program instructions and data include all forms of non-volatile memory, including by way of example semiconductor memory devices, such as EPROM, EEPROM, and flash memory devices; magnetic disks such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM disks. Any of the foregoing can be supplemented by, or incorporated in, ASICs (application-specific integrated circuits).

A number of implementations of the invention have been described. Nevertheless, it will be understood that various modifications may be made without departing from the spirit and scope of the invention. Accordingly, other implementations are within the scope of the following claims. 

What is claimed is:
 1. An integrated circuit comprising: one or more ports to transmit and receive packets of first data on a network; and a forwarding engine to transfer the packets of the first data between the ports; wherein at least one of the ports comprises: a packet generator to originate a first packet of the first data received by the at least one of the ports from the network, wherein the first packet comprises second data representing a time of generation of the first packet of the first data; a network transmit interface to transmit the first packet of the first data; a network receive interface to receive a second packet transmitted in reply to the first packet of the first data; and a controller to calculate a network delay that includes a queue delay that occurs when the first packet is queued for transmission based on the second data representing the time of generation of the first packet of the first data and the second packet.
 2. The integrated circuit of claim 1: wherein the controller calculates the network delay based on the second data representing the time of generation of the first packet of the first data and a time of receipt of the second packet by the network receive interface.
 3. The integrated circuit of claim 1: wherein the second packet comprises third data; and wherein the controller calculates the network delay based on the second data representing the time of generation of the first packet of the first data and the third data in the second packet.
 4. The integrated circuit of claim 3: wherein the third data in the second packet represents a time of transmission of the second packet.
 5. The integrated circuit of claim 3: wherein the third data in the second packet represents a time of receipt of the first packet of the first data.
 6. The integrated circuit of claim 1: wherein the controller calculates a plurality of the network delays; and determines a network jitter based on the plurality of the network delays.
 7. The integrated circuit of claim 1, wherein the at least one of the ports further comprises: an egress queue to store the packets of the first data received by the at least one of the ports from the forwarding engine; a test queue to store the packets of the first data originated by the packet generator; and a scheduler comprising a first input in communication with the egress queue, a second input in communication with the test queue, and an output in communication with the network transmit interface.
 8. The integrated circuit of claim 1, wherein the at least one of the ports further comprises: an ingress queue to store the packets of the first data received by the network receive interface.
 9. The integrated circuit of claim 1, further comprising: a classifier to determine one or more properties of the packets of the first data received by the network receive interface; and a counter to count a number of packets of the first data received by the network receive interface that have properties that match one or more property definitions.
 10. The integrated circuit of claim 9, wherein the one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the ports in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data.
 11. The integrated circuit of claim 9, wherein the at least one of the ports: receives a request for contents of the counter; and transmits a packet of the first data comprising the contents of the counter.
 12. A network switch comprising the integrated circuit of claim
 1. 13. A network device comprising the integrated circuit of claim
 1. 14. The network device of claim 13, wherein the network device includes one of a wireless access point and a wireless client station.
 15. The network device of claim 14, further comprising: a user interface to provide one or more property definitions to the integrated circuit, and to retrieve contents of a counter.
 16. A method comprising: transmitting and receiving packets of first data on a network via a plurality of ports of an integrated circuit; transferring the packets of the first data between the ports; generating using a packet generator included in one of the ports a first packet of the first data received by the one of the ports from the network, wherein the first packet comprises second data representing a time of generation of the first packet of the first data; transmitting the first packet of the first data; receiving a second packet transmitted in reply to the first packet of the first data; and calculating a network delay that includes a queue delay that occurs when the first packet is queued for transmission based on the second data representing the time of generation of the first packet of the first data and the second packet using a controller included in the one of the ports.
 17. The method of claim 16: wherein the network delay is calculated based on the second data representing the time of generation of the first packet of the first data and a time of receipt of the second packet by the integrated circuit.
 18. The method of claim 16: wherein the second packet comprises third data; and wherein the network delay is calculated based on the second data representing the time of generation of the first packet of the first data and the third data in the second packet.
 19. The method of claim 18: wherein the third data in the second packet represents a time of transmission of the second packet.
 20. The method of claim 18: wherein the third data in the second packet represents a time of receipt of the first packet of the first data.
 21. The method of claim 16, further comprising: calculating a plurality of the network delays; and determining a network jitter based on the plurality of the network delays.
 22. The method of claim 16, further comprising: determining one or more properties of the received packets of the first data; and counting a number of packets of the first data received by the network receive interface that have properties that match one or more property definitions.
 23. The method of claim 22, wherein the one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the ports in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data.
 24. The method of claim 16, further comprising: receiving a request for the number of packets of the first data received by the network receive interface that have properties that match one or more property definitions; and transmitting a packet of the first data comprising the number of packets of the first data received by the network receive interface that have properties that match the one or more property definitions.
 25. An integrated circuit comprising: one or more ports to transmit and receive packets of first data on a network; and a host interface to transmit and receive the packets of the first data; wherein at least one of the ports comprises: a packet generator to originate a first packet of the first data received by the at least one of the ports from the network, wherein the first packet comprises second data representing a time of generation of the first packet of the first data; a network transmit interface to transmit the first packet of the first data; a network receive interface to receive a second packet transmitted in reply to the first packet of the first data; and a controller to calculate a network delay that includes a queue delay that occurs when the first packet is queued for transmission based on the second data representing the time of generation of the first packet of the first data and the second packet.
 26. The integrated circuit of claim 25: wherein the controller calculates the network delay based on the second data representing the time of generation of the first packet of the first data and a time of receipt of the second packet by the network receive interface.
 27. The integrated circuit of claim 25: wherein the second packet comprises third data; and wherein the controller calculates the network delay based on the second data representing the time of generation of the first packet of the first data and the third data in the second packet.
 28. The integrated circuit of claim 27: wherein the third data in the second packet represents a time of transmission of the second packet.
 29. The integrated circuit of claim 27: wherein the third data in the second packet represents a time of receipt of the first packet of the first data.
 30. The integrated circuit of claim 25: wherein the controller calculates a plurality of the network delays; and determines a network jitter based on the plurality of the network delays.
 31. The integrated circuit of claim 25, wherein the at least one of the ports further comprises: an egress queue to store the packets of the first data received by the at least one of the ports from the host interface; a test queue to store the packets of the first data originated by the packet generator; and a scheduler comprising a first input in communication with the egress queue, a second input in communication with the test queue, and an output in communication with the network transmit interface.
 32. The integrated circuit of claim 25, wherein the at least one of the ports further comprises: an ingress queue to store the packets of the first data received by the network receive interface.
 33. The integrated circuit of claim 25: wherein the at least one of the ports further comprises a network receive interface to receive packets of the first data; and wherein the integrated circuit further comprises a classifier to determine one or more properties of the packets of the first data received by the network receive interface, and a counter to count a number of packets of the first data received by the network receive interface that have properties that match one or more property definitions.
 34. The integrated circuit of claim 33, wherein the one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the ports in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data.
 35. The integrated circuit of claim 33, wherein the at least one of the ports: receives a request for the contents of the counter; and transmits a packet of the first data comprising the contents of the counter.
 36. A network switch comprising the integrated circuit of claim
 25. 37. A network device comprising the integrated circuit of claim
 25. 38. A network interface controller (NIC) comprising the integrated circuit of claim
 25. 39. The network device of claim 38, further comprising: a user interface to provide one or more property definitions to the integrated circuit, and to retrieve contents of a counter.
 40. A method comprising: transmitting and receiving packets of first data on a network via one or more ports of an integrated circuit; generating using a packet generator included in one of the ports a first packet of the first data received by the one of the ports from the network, wherein the first packet comprises second data representing a time of generation of the first packet of the first data; transmitting the first packet of the first data; receiving a second packet transmitted in reply to the first packet of the first data; and calculating a network delay that includes a queue delay that occurs when the first packet is queued for transmission based on the second data representing the time of generation of the first packet of the first data and the second packet using a controller included in the one of the ports.
 41. The method of claim 40: wherein the network delay is calculated based on the second data representing the time of generation of the first packet of the first data and a time of receipt of the second packet by the network receive interface.
 42. The method of claim 40: wherein the second packet comprises third data; and wherein the network delay is calculated based on the second data representing the time of generation of the first packet of the first data and the third data in the second packet.
 43. The method of claim 42: wherein the third data in the second packet represents a time of transmission of the second packet.
 44. The method of claim 42: wherein the third data in the second packet represents a time of receipt of the first packet of the first data.
 45. The method of claim 40, further comprising: calculating a plurality of the network delays; and determining a network jitter based on the plurality of the network delays.
 46. The method of claim 40, further comprising: determining one or more properties of the received packets of the first data, and counting a number of packets of the first data received by the network receive interface that have properties that match one or more property definitions.
 47. The method of claim 46, wherein the one or more property definitions comprise at least one of the group consisting of: a value for a field in the packets of the first data that indicates the packets of the first data were originated by one of the ports in the integrated circuit; a value for a field in the packets of the first data that indicates the packets of the first data were originated by a port in another integrated circuit; and one or more qualities of service for the packets of the first data.
 48. The method of claim 40, further comprising: receiving a request for the number of packets of the first data received by the network receive interface that have properties that match one or more property definitions; and transmitting a packet of the first data comprising the number of packets of the first data received by the network receive interface that have properties that match the one or more property definitions.
 49. The integrated circuit of claim 1: wherein the controller: includes in the first packet third data representing a time of transmission when the first packet is transmitted; and calculates the network delay based on the third data representing the time of transmission of the first packet and a time of receipt of the second packet by the network receive interface.
 50. The integrated circuit of claim 25: wherein the controller: includes in the first packet third data representing a time of transmission when the first packet is transmitted; and calculates the network delay based on the third data representing the time of transmission of the first packet and a time of receipt of the second packet by the network receive interface.
 51. The method of claim 16 further comprising: including in the first packet third data representing a time of transmission when the first packet is transmitted; and calculating the network delay based on the third data representing the time of transmission of the first packet and a time of receipt of the second packet.
 52. The method of claim 40 further comprising: including in the first packet third data representing a time of transmission when the first packet is transmitted; and calculating the network delay based on the third data representing the time of transmission of the first packet and a time of receipt of the second packet. 